<%@ page contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <!-- jsp文件头和头部 -->
    <%@ include file="../../system/admin/top.jsp" %>
    <link rel="stylesheet" href="static/css/zcss/soso.css"/>
</head>
<body>

<div class="container-fluid" id="main-container">

    <div id="page-content" class="clearfix">

        <div class="row-fluid">
            <!-- 检索  -->
            <form action="cardnode/list.do" method="post" name="Form" id="Form" class="zform">

                <table class="zform-tab">
                    <tr>
                        <td>
                                <span class="input-icon sosodiv">
                                    <input autocomplete="off" class="nav-search-input" type="text"
                                           name="userNameKey" id="userNameKey" value="${userNameKey}"
                                           placeholder="请输入用户名或账号"/>
                                <i id="nav-search-icon" class="icon-search"></i>
                                 <ul id="solist">
                                    <li></li>
                                    <li></li>
                                    <li></li>
                                    <li></li>
                                    <li></li>
                                    <li></li>
                                    <li></li>
                                    <li></li>
                                    <li></li>
                                    <li></li>
                                </ul>
                            </span>
                        </td>
                        <td><span class="input-icon sosodiv">
                                <input
                                        autocomplete="off" class="nav-search-input" class="zaiinput" type="text"
                                        data-key="zphone" name="msisdnKey" id="msisdnKey" value="${msisdnKey}"
                                        placeholder="请输入号段关键词"/>

										<i id="nav-search-icon" class="icon-search"></i>
                            </span>
                        </td>
                        <td class="tdbtn">
                            <button type="button" id="zbtn" onclick="search();" title="检索"
                                    style="line-height: 27px;width: 80%;background: #438EB9!important;border: none;border-radius: 8px!important;color: #fff;margin-top: 3px;">
                                搜索
                            </button>
                        </td>
                        <%--<c:if test="${QX.cha == 1 }">--%>
                        <%--<td class="tdbtn"><a class="btn" id="zbtn-down" onclick="toExcel();" title="导出EXCEL"--%>
                        <%--download="号段管理明细"--%>
                        <%--style="line-height: 22px;height: 22px;padding: 0 0;width: 100%;margin-top: 8px;font-size: 12px;background: #438EB9 !important;border: none !important;">--%>
                        <%--<i id="nav-search-icon" class="icon-download-alt"></i>导出EXCEL</a>--%>
                        <%--</td>--%>
                        <%--</c:if>--%>
                    </tr>
                </table>
            </form>
            <!-- 检索  -->

            <table id="table_report" class="table table-striped table-bordered table-hover">

                <thead>
                <tr>
                    <th class="center">序号</th>
                    <th class="center">号段起始</th>
                    <th class="center">号段结束</th>
                    <th class="center">号段卡数</th>
                    <th class="center">计费卡数</th>
                    <th class="center">用户名</th>
                    <th class="center">子用户</th>
                    <c:if test="${isAdmin == '1'}">
                        <th class="center">移动激活日</th>
                    </c:if>
                    <th class="center">用户激活日</th>
                    <c:if test="${isAdmin == '1'}">
                        <th class="center">平台</th>
                        <th class="center">移动套餐</th>
                    </c:if>
                    <th class="center">用户套餐</th>
                    <th class="center">按年价格</th>
                    <th class="center">操作</th>
                </tr>
                </thead>

                <tbody>

                <!-- 开始循环 -->
                <c:choose>
                    <c:when test="${not empty varList}">
                        <%--<c:if test="${QX.cha == 1 }">--%>
                        <c:forEach items="${varList}" var="var" varStatus="vs">
                            <tr>
                                <td class='center' style="width: 30px;">${vs.index+1}</td>
                                <td>${var.start}</td>
                                <td>${var.end}</td>
                                <td>${var.end - var.start + 1}</td>
                                <td>${var.activeNum}</td>
                                <td>${var.userName}</td>
                                <td>${var.subUserName}</td>
                                <c:if test="${isAdmin == '1'}">
                                    <td>${var.openDateStr}</td>
                                </c:if>
                                <td>${var.userOpenDateStr}</td>
                                <c:if test="${isAdmin == '1'}">
                                    <td>${var.appId}</td>
                                    <td>${var.pkgStr}</td>
                                </c:if>
                                <td>${var.userPkgStr}</td>
                                <td>${var.userPrice}</td>
                                <td style="width: 30px;" class="center">
                                    <a class="btn btn-mini btn-info" title="编辑" onclick="edit('${var.id}');">
                                        <i class="icon-edit"></i>
                                    </a>
                                </td>
                            </tr>

                        </c:forEach>
                        <%--</c:if>--%>
                        <%--<c:if test="${QX.cha == 0 }">--%>
                        <%--<tr>--%>
                        <%--<td colspan="14" class="center">您无权查看</td>--%>
                        <%--</tr>--%>
                        <%--</c:if>--%>
                    </c:when>
                    <c:otherwise>
                        <tr class="main_info">
                            <td colspan="14" class="center">没有相关数据</td>
                        </tr>
                    </c:otherwise>
                </c:choose>


                </tbody>
            </table>

            <div class="page-header position-relative" style="float: left;width: 100%;">
                <table style="width:100%;">
                    <tr>
                        <td>
                            <div class="pagination"
                                 style="float: right;padding-top: 0px;margin-top: 0px;">${page.getPageStr()}</div>
                        </td>
                    </tr>
                </table>
            </div>


        </div>

    </div>

</div>

<!-- 返回顶部  -->
<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse"> <i
        class="icon-double-angle-up icon-only"></i> </a>

<!-- 引入 -->
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/ace-elements.min.js"></script>
<script src="static/js/ace.min.js"></script>

<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script>
<!-- 下拉框 -->
<script type="text/javascript"
        src="static/js/bootstrap-datepicker.min.js"></script>
<!-- 日期框 -->
<script type="text/javascript" src="static/js/bootbox.min.js"></script>
<!-- 确认窗口 -->
<!-- 引入 -->
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
<script type="text/javascript" src="static/js/zjs/soso.js"></script>
<!--提示框-->
<script type="text/javascript">

    $(top.hangge());

    //检索
    function search() {
        top.jzts();
        $("#Form").submit();
    }


    //修改
    function edit(Id) {
        top.jzts();
        var diag = new top.Dialog();
        diag.Drag = true;
        diag.Title = "编辑";
        diag.URL = '<%=basePath%>cardnode/goEdit.do?id=' + Id;
        diag.Width = 450;
        diag.Height = 625;
        diag.CancelEvent = function () { //关闭事件
            if (diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none') {
                nextPage(${page.currentPage});
            }
            diag.close();
        };
        diag.show();
    }
</script>

<script type="text/javascript">

    $(function () {

        //下拉框
        $(".chzn-select").chosen();
        $(".chzn-select-deselect").chosen({allow_single_deselect: true});

        //日期框
        $('.date-picker').datepicker();
    });

    //导出excel
    function toExcel() {
        var phone = $("#msisdnKey").val();
        var userid = $("#userNameKey").val();
        console.log("msisdnKey=" + phone + "&userNameKey=" + userid);
        window.location.href = "<%=basePath%>cardnode/download?msisdnKey=" + phone + "&userNameKey=" + userid;
    }
</script>

</body>
</html>

